package com.example.hotelrear.controller;

import com.example.hotelrear.entity.Order;
import com.example.hotelrear.entity.ResponseResult;
import com.example.hotelrear.service.AdviceService;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author FengXiao
 * @since 2023-08-28
 */
@RestController
@RequestMapping("/comment")
public class CommentController {
    @Resource
    private AdviceService adviceService;
    @GetMapping("/sendAdvice")
    public ResponseResult sendAdvice(@Param("id") int id,String message) {
        boolean sendAdvice= adviceService.sendAdvice(id,message);
        if(sendAdvice){
            return ResponseResult.ok(sendAdvice);
        }
        return ResponseResult.fail("反馈失败");

    }

}
